package com.fh.controller.system.dictionaries;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fh.controller.base.BaseController;
import com.fh.service.system.dictionaries.DictionariesService;
import com.fh.util.AppUtil;
import com.fh.util.PageData;

/**
 * 类名称：DictionariesController
 * 创建人：FH
 * 创建时间：2014年9月2日
 * 
 * @version
 */
@Controller
@RequestMapping(value = "/dictionariesTree")
public class DictionariesTreeController extends BaseController {

	@Resource(name = "dictionariesService")
	private DictionariesService dictionariesService;
	private final static String familyid = "6cd1b267464d433086a1a3ee789209bc";

	/**
	 * 
	 * TODO 方法作用：家属关系字典
	 * 
	 * @return
	 * @Author: 孙超文
	 * @Date: 2015-10-21 上午9:42:39
	 */
	@ResponseBody
	@RequestMapping(value = "/familyTree")
	public Object familyTree() {
		Map<String, Object> map = new HashMap<String, Object>();
		PageData pd = new PageData();
		pd = this.getPageData();

		List<PageData> list = new ArrayList<PageData>();
		try {
			pd.put("PARENT_ID", familyid);
			list = dictionariesService.listAll(pd);

		} catch (Exception e) {
			e.printStackTrace();
		}
		map.put("result", "success");
		map.put("data", list);
		return AppUtil.returnObject(new PageData(), map);
	}

}
